package com.affablebeans.model.program;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import java.util.List;

import javax.swing.JButton;

import com.affablebeans.model.DbContext;
import com.affablebeans.model.entity.Category;
import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;

/**
 *
 * @author Bora SAYINER
 * @since Jan 26, 2015 3:54:38 PM
 * @version 1.0
 */
public class Driver {

	private static final MysqlDataSource dataSource = new MysqlDataSource();

	static {
		dataSource.setURL("jdbc:mysql://localhost:3306/affablebean");
		dataSource.setUser("root");
		dataSource.setPassword("Passw0rd");
	}

	public static void main(String[] args) throws SQLException {
		// DbContext dbContext = new DbContext(dataSource);
		// List<Category> categories =
		// dbContext.getCategories().getAllCategories();
		// categories.forEach(c -> System.out.println(c.getName()));

		Thread thread = new Thread(new Runnable() {
			@Override
			public void run() {
				System.out.println("Hello World");
			}
		});
		thread.start();

		Thread thread2 = new Thread(() -> System.out.println(""));

		JButton button = new JButton("Click");
		button.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {

			}
		});

		JButton button2 = new JButton("Click");
		button2.addActionListener((e) -> System.out.print("asd"));

	}
}
